package su.api.mock.controller;

import javax.annotation.Resource;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

import su.api.mock.config.RedisCacheResolver;

@RestController
public class ConfigController {

    @Resource
    private RedisCacheResolver redisCacheResolver;

    @GetMapping("/onoff/{state}")
    public String onoff(String key, @PathVariable("state") Integer state) {
        redisCacheResolver.config(key, state);
        return "success";
    }

}
